package com.action.member;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.controller.Action;
import com.dao.RentalDao;

public class AdminRentalProAction implements Action{
	@Override
	public String execute(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		HttpSession session = request.getSession();
		if(!session.getAttribute("mem_id").equals("admin") || session.getAttribute("mem_id") == null){
			return "/view/member/loginForm.jsp";
		}
		
		int rent_num = Integer.parseInt(request.getParameter("rent_num"));
		RentalDao dao = RentalDao.getInstance();
		dao.updateState(rent_num);
		
		return "/view/member/adminRentalForm.do";
	}
}
